package com.hunliji.monitor.service.impl;

import com.hunliji.monitor.dao.mapper.ad.ZdxConsumeMapper;
import com.hunliji.monitor.dao.model.dataobject.ZdxConsumeDO;
import com.hunliji.monitor.dao.model.param.QueryZdxConsumeDataParam;
import com.hunliji.monitor.service.api.ZdxConsumeService;
import com.hunliji.monitor.service.api.model.bo.ZdxConsumeBO;
import com.hunliji.monitor.service.api.model.param.QueryZdxConsumeParam;
import com.hunliji.monitor.share.component.ComponentLocator;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 智多星查询
 * @author wuchen
 */
@Service
public class ZdxConsumeServiceImpl implements ZdxConsumeService {
    @Resource
    private ZdxConsumeMapper zdxConsumeMapper;
    @Override
    public List<ZdxConsumeBO> query(QueryZdxConsumeParam queryZdxConsumeParam) {
        QueryZdxConsumeDataParam queryZdxConsumeDataParam = ComponentLocator.getConverter().convert(queryZdxConsumeParam,QueryZdxConsumeDataParam.class);
        List<ZdxConsumeDO> zdxConsumeDOList = zdxConsumeMapper.generalQuery(queryZdxConsumeDataParam);
        return ComponentLocator.getConverter().convertList(zdxConsumeDOList,ZdxConsumeBO.class);
    }

    @Override
    public List<ZdxConsumeBO> generalQueryByRecord(QueryZdxConsumeParam queryZdxConsumeParam) {
        QueryZdxConsumeDataParam queryZdxConsumeDataParam = ComponentLocator.getConverter().convert(queryZdxConsumeParam,QueryZdxConsumeDataParam.class);
        List<ZdxConsumeDO> zdxConsumeDOList = zdxConsumeMapper.generalQueryByRecord(queryZdxConsumeDataParam);
        return ComponentLocator.getConverter().convertList(zdxConsumeDOList,ZdxConsumeBO.class);
    }
}
